{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "prepared-station",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "AA\n",
      "AB\n",
      "AC\n",
      "BA\n",
      "BB\n",
      "BC\n",
      "CA\n",
      "CB\n",
      "CC\n"
     ]
    }
   ],
   "source": [
    "import itertools\n",
    "INPUT_NUMBER = 22\n",
    "INPUT = [str(i) for i in list(map(int,str(INPUT_NUMBER)))]\n",
    "dic = {\n",
    "    '0':' ',\n",
    "    '1':' ',\n",
    "    '2':'ABC',\n",
    "    '3':'DEF',\n",
    "    '4':'GHI',\n",
    "    '5':'JKL',\n",
    "    '6':'MNO',\n",
    "    '7':'PQRS',\n",
    "    '8':'TUV',\n",
    "    '9':'WXYZ',\n",
    "    'star':'',\n",
    "    'pound':'',\n",
    "}\n",
    "res=[dic[i] for i in INPUT]\n",
    "tuptmp = tuple(res)\n",
    "for x in itertools.product(*tuptmp):\n",
    "    ltmp = ''\n",
    "    ltmp = ''.join(i for i in x)\n",
    "    print(ltmp)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.2"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
